Skip to content

fix(init): skip binary automatic pre-reads - #1402

Closed
betegon wants to merge 1 commit into
mainfrom
fix/init-skip-binary-reads
Closed

betegon wants to merge 1 commit into
mainfrom
fix/init-skip-binary-reads

Conversation

@betegon

@betegon betegon commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

The init preflight eagerly reads a small allowlist of common manifests and config files into initial workflow state. A binary file masquerading under one of those names should not be decoded and injected before any agent has asked for it.

Summary

  • Read automatic preflight candidates as bytes and apply the existing bounded NUL-byte classifier before UTF-8 decoding
  • Store the existing null sentinel when an automatic pre-read candidate is binary
  • Leave the full directory listing unchanged, including binary paths
  • Deliberately leave the generic read-files tool unchanged: after an agent selects a path from the listing, the existing maxBytes-bounded read is allowed
  • Add a regression test proving that automatic binary pre-reads are skipped while an explicitly requested binary path remains readable

The follow-up #1404 adds scan and read diagnostics without changing that distinction.

Test plan

  • 21 focused pre-read and filesystem-tool tests
  • Biome check on changed files
  • pnpm typecheck

@vercel

vercel Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview Aug 11, 2026 1:11pm

Request Review

@betegon
betegon force-pushed the fix/init-skip-binary-reads branch from fa4e94c to 4cbd0b3 Compare August 11, 2026 08:00
@betegon
betegon force-pushed the fix/init-skip-binary-reads branch from 4cbd0b3 to 9c96178 Compare August 11, 2026 13:06
@betegon betegon changed the title fix(init): skip binary repository reads fix(init): skip binary automatic pre-reads Aug 11, 2026

This branch was successfully deployed

1 active deployment
Preview — 2215e63a Deployed Aug 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant